# -*- coding=utf-8 -*-
'''
Created on Aug 4, 2016

@author: corvo
'''

from sqlalchemy import Column, Integer, VARCHAR, DateTime, Boolean
from models import Base


class Express(Base):
    __tablename__ = "ExpressData"
    id            = Column(Integer, nullable    = False, primary_key = True)
    cardnum       = Column(VARCHAR(9), nullable = False) # 一卡通号, 防止恶意
    #uuid          = Column(VARCHAR(64))                                     # uuid校验
    sms           = Column(VARCHAR(256))                                     # 快递短信
    user          = Column(VARCHAR(64))                                      # 客户姓名
    phone         = Column(VARCHAR(64))                                      # 客户联系电话
    dest          = Column(VARCHAR(64))                                      # 客户取快递地点
    arrival       = Column(VARCHAR(64))                                      # 客户取快递时间段
    locate        = Column(VARCHAR(64))                                      # 快件所在地(东门/南门)
    weight        = Column(VARCHAR(64))                                      # 快件重量
    submittime    = Column(DateTime())                                       # 信息提交时间
    receiving    = Column(Boolean, unique = False, default = False)         # 是否有人接单
    finish        = Column(Boolean, unique = False, default = False)         # 已经交到用户手中, 本次代取结束

class ExpressModify(Base):
    """
        保存每个管理员的修改内容
    """
    __tablename__ = "ExpressModify"
    id = Column(Integer, nullable = False, primary_key = True)
    superuser = Column(VARCHAR(9), nullable=False)      # 管理员id
    modify = Column(VARCHAR(2048))                      # 管理员修改内容
    modifytime = Column(DateTime())                     # 信息提交时间
